package com.domain;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

/**
*@Author: 喻晓涵
*@CreateTime: 2025-08-05
*@Description: ${description}
*@Version: 1.0
*/


/**
 * 问题表
 */
@Data
public class Question implements java.io.Serializable{
    /**
    * 问题ID，主键自增
    */
    @NotNull(message = "问题ID，主键自增不能为null")
    @JsonProperty("id")
    private Long id;

    /**
    * 题目内容
    */
    @Size(max = 1000,message = "题目内容最大长度要小于 1000")
    @JsonProperty("content")
    private String content;

    /**
    * 题目难度(1-5)
    */
    @NotNull(message = "题目难度(1-5)不能为null")
    @JsonProperty("difficulty")
    private Byte difficulty;

    /**
    * 题目类型(1-单选 2-多选 3-判断)
    */
    @NotNull(message = "题目类型(1-单选 2-多选 3-判断)不能为null")
    @JsonProperty("type")
    private Byte type;

    // Getter 和 Setter 方法
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Byte getDifficulty() {
        return difficulty;
    }

    public void setDifficulty(Byte difficulty) {
        this.difficulty = difficulty;
    }

    public Byte getType() {
        return type;
    }

    public void setType(Byte type) {
        this.type = type;
    }

    //tostring
    @Override
    public String toString() {
        return "Question{" +
                "id=" + id +
                ", content='" + content + '\'' +
                ", difficulty=" + difficulty +
                ", type=" + type +
                '}';
    }
}